package com.jh.apical;

import java.util.Calendar;

public class CalAPI 
{
	public void printCal(int year,int month)
	{
		Calendar cal = Calendar.getInstance();
		
		int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);
		int totalMonthDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
		
		/*System.out.println(dayOfWeek);
		System.out.println(totalMonthDay);*/
		
		System.out.printf("\t\t  %d 년 \t %d월\n",year,month);
		System.out.printf("일\t월\t화\t수\t목\t금\t토\n");
		
		//공백 찍기
		for (int i = 1; i < dayOfWeek; i++) 
		{
			System.out.print("-\t");
		}
		
		for (int i = 1; i < totalMonthDay; i++) 
		{
			System.out.print(i+"\t");
			if ((i+dayOfWeek-1)%7==0) 
			{
				System.out.print("\n");
			}
		}
	}
}
